home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Dylan Related / Mindy / Mindy 1.2 - portable sources / interp / func.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-15  |  4.1 KB  |  106 lines  |  [TEXT/ttxt]

  1. /**********************************************************************\
  2. *
  3. *  Copyright (c) 1994  Carnegie Mellon University
  4. *  All rights reserved.
  5. *  
  6. *  Use and copying of this software and preparation of derivative
  7. *  works based on this software are permitted, including commercial
  8. *  use, provided that the following conditions are observed:
  9. *  
  10. *  1. This copyright notice must be retained in full on any copies
  11. *     and on appropriate parts of any derivative works.
  12. *  2. Documentation (paper or online) accompanying any system that
  13. *     incorporates this software, or any part of it, must acknowledge
  14. *     the contribution of the Gwydion Project at Carnegie Mellon
  15. *     University.
  16. *  
  17. *  This software is made available "as is".  Neither the authors nor
  18. *  Carnegie Mellon University make any warranty about the software,
  19. *  its performance, or its conformity to any specification.
  20. *  
  21. *  Bug reports, questions, comments, and suggestions should be sent by
  22. *  E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
  23. *
  24. ***********************************************************************
  25. *
  26. * $Header: func.h,v 1.11 94/11/06 20:00:10 rgs Exp $
  27. *
  28. \**********************************************************************/
  29.  
  30.  
  31. extern obj_t obj_FunctionClass;
  32. extern obj_t obj_MethodInfoClass;
  33. extern obj_t obj_MethodClass;
  34. extern obj_t obj_ByteMethodClass;
  35. extern obj_t obj_GFClass;
  36. extern obj_t obj_CFunctionClass;
  37.  
  38. struct method_info {
  39.     obj_t class;
  40.     boolean restp;
  41.     obj_t keys;
  42.     boolean all_keys;
  43.     obj_t component;
  44.     int n_closure_vars;
  45. };
  46.  
  47. #define METHOD_INFO(o) obj_ptr(struct method_info *, o)
  48.  
  49. extern obj_t make_raw_function(char *debug_name, int required_args,
  50.                    boolean restp, obj_t keywords, boolean all_keys,
  51.                    obj_t result_types, obj_t more_results_type,
  52.                    void (*xep)(struct thread *thread, int nargs));
  53.  
  54. extern obj_t make_raw_method(char *debug_name, obj_t specializers,
  55.                  boolean restp, obj_t keywords, boolean all_keys,
  56.                  obj_t result_types, obj_t more_results_type,
  57.                  void (*iep)(obj_t self, struct thread *thread,
  58.                       obj_t *args));
  59. extern void set_method_iep(obj_t method,
  60.                void (*iep)(obj_t self, struct thread *thread,
  61.                     obj_t *args));
  62. extern obj_t make_builtin_method(char *debug_name, obj_t specializers,
  63.                  boolean restp, obj_t keys, boolean all_keys,
  64.                  obj_t result_type, obj_t (*func)());
  65. extern obj_t make_method_info(boolean rest_p, obj_t keys, boolean all_keys,
  66.                   obj_t component, int n_closure_vars);
  67. extern obj_t make_byte_method(obj_t method_info, obj_t specializers,
  68.                   obj_t result_types, obj_t more_results_type,
  69.                   obj_t *lexenv);
  70. extern obj_t byte_method_component(obj_t byte_method);
  71.  
  72. extern obj_t make_accessor_method(obj_t debug_name, obj_t class, obj_t type,
  73.                   boolean setter, obj_t datum,
  74.                   void (*iep)(obj_t self, struct thread *thread,
  75.                        obj_t *args));
  76. extern obj_t accessor_method_datum(obj_t method);
  77. extern void set_accessor_method_datum(obj_t method, obj_t datum);
  78.  
  79. extern obj_t make_c_function(obj_t debug_name, void *pointer);
  80.  
  81. extern obj_t make_generic_function(obj_t debug_name, int required_args,
  82.                    boolean restp, obj_t keys, boolean all_keys,
  83.                    obj_t result_types,obj_t more_results_type);
  84. extern obj_t make_default_generic_function(obj_t debug_name, obj_t method);
  85. extern void set_gf_signature(obj_t gf, int req_args, boolean restp,
  86.                  obj_t keys, boolean all_keys, obj_t result_types,
  87.                  obj_t more_results_type);
  88.  
  89. extern obj_t generic_function_methods(obj_t gf);
  90. extern obj_t add_method(obj_t gf, obj_t method);
  91.  
  92. extern void invoke(struct thread *thread, int nargs);
  93. extern obj_t *push_linkage(struct thread *thread, obj_t *args);
  94. extern void set_c_continuation(struct thread *thread,
  95.                    void (*cont)(struct thread *thread, obj_t *vals));
  96. extern obj_t *pop_linkage(struct thread *thread);
  97. #if SLOW_LONGJMP
  98. #define do_return do_return_setup
  99. #else
  100. extern void do_return(struct thread *thread, obj_t *old_sp, obj_t *vals);
  101. #endif
  102. extern void do_return_setup(struct thread *thread, obj_t *old_sp, obj_t *vals);
  103.  
  104. extern obj_t function_debug_name(obj_t func);
  105. extern obj_t function_debug_name_or_self(obj_t func);
  106.